﻿@{
    Layout = "~/Areas/Admin/Views/Shared/_LayoutCMS.cshtml";
    ViewBag.Title = "文章信息操作";
}

@section htmlhead{
    <link href="~/Content/assets/css/Layout/css/main.css" rel="stylesheet" />
    <link href="~/Content/assets/css/plugin/validator.css" rel="stylesheet" />
}
@model LY.Entity.C_Article

<div class="container">

    <div id="forms" class="mt10">
        <div class="box">
            <div class="box_border">
                <div class="box_top"><b class="pl15">文章信息操作</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;带“ <span style="color: red">*</span> ”标示为必填项</div>
                <div class="box_center">
                    <form  id="frmEdit" method="post" action="@Url.Action("ArticleSave")" role="form" class="jqtransform">
                        <input id="hideId" name="Id" value="@Model.ID" type="hidden" />
                        <input id="Menu" name="Menu" value="@Model.Menu" type="hidden" />
                        <input id="MenuId" name="MenuId" value="@Model.MenuId" type="hidden" />

                        <table class="form_table pt15 pb15" style="width: 100%;" border="0">
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;栏目：</td>
                                <td class="">
                                    @*<input type="text" id="lbMenu" name="lbMenu" readonly="readonly" value="@Model.Menu" placeholder="请选择栏目"/>*@@*@ViewBag.ParentName</input>*@@*<input type="button" onclick="util.GetParentName()" id="btnAdd" name="button" class="btn btn82 btn_add" value="+">*@
                                    @*<input id="UpperID" name="UpperID" value="@Model.MenuId" type="hidden" />*@

                             @*@Html.ResourceDropDownList("MenuId", "MenuTree", @Model.MenuId, new { @class = "wh160 select" })*@

                              @Html.ResourceDropDownList("UpperIDtree", "MenuTree", @Model.MenuId, new { @class = "wh160 select" })
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;文章标题：</td>
                                <td class="">
                                    <input type="text" id="Name" name="Name" value="@Model.Name" class="input-text lh30" size="40" placeholder="请输入文章标题"><a href="javascript:;" id="selectProject">选择项目</a>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">文章来源：</td>
                                <td class="">
                                    <input type="text" id="Source" name="Source" value="@Model.Source" class="input-text lh30" size="40" >
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;文章作者：</td>
                                <td class="">
                                    <input type="text" id="Author" name="Author" value="@Model.Author" class="input-text lh30" size="40" placeholder="请输入文章作者" >
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">关键字：</td>
                                <td class="">
                                    <input type="text" id="Keywords" name="Keywords" value="@Model.Keywords" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">远程连接：</td>
                                <td class="">
                                    <input type="text" id="URL" name="URL" value="@Model.URL" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;发布时间：</td>
                                <td class="">
                                    <input type="text" id="PublishTime" name="PublishTime" placeholder="请选择日期" onclick="WdatePicker();" value="@Model.PublishTime" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">排序：</td>
                                <td class="">
                                    <input type="text" id="Sequence" name="Sequence" value="@Model.Sequence"  class="input-text lh30" size="40" onblur="util.GetSequence(this.id,this.value)" >&nbsp;输入规则：<span style="color: red">必须为整数数字格式, 默认值为‘ 0 ’</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;内容摘要：</td>
                                <td class="">
                                    <textarea id="Synopsis" rows="4" style="width: 295px" name="Synopsis" placeholder="请输入内容摘要">@Model.Synopsis</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">文章置顶：</td>
                                <td class="">
                                    @Html.ResourceRadioList("IsTop", "ISTOP", Model.IsTop == null ? 0 : Model.IsTop, true)
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">标题图片：</td>
                                <td class="">
                                    <div class="uploadImg">
                                        <img id="imgShow" style="width: 296px; height: 180px" src="@Model.PicturesPath" />
                                        <input type="hidden" id="TitlePic" name="TitlePic"  value="@Model.TitlePic"/>
                                        <input type="hidden" id="Pictures" name="Pictures" value="@Model.Pictures"/>
                                        <input type="hidden" id="fileName" name="PicturesPath" value="@Model.PicturesPath"/>
                                        <input type="button" id="btnUploadImg" value="上传" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><span style="color: red">*</span>&nbsp;文章正文内容：</td>
                                <td class="">
                                  <textarea id="Content" name="Content" rows="10" style="height: 260px; width: 90%">@Model.Content</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"></td>
                                <td class=""></td>
                            </tr>
                            <tr>
                                <td class="td_right">&nbsp;</td>
                                <td class="">
                                    <input type="button" id="btnSave" name="button" class="btn btn82 btn_save2" value="保存">
                                    <input type="button" id="btnReturn" name="button" class="btn btn82 btn_res" value="返回">
                                </td>
                            </tr>
                        </table> 
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section jssection{

    <script type="text/javascript">
        var util = {};
        var options = {
            MenuTreeUrl: "@Url.Action("MenuTree")",
            uploadUrl: "@Url.Action("UploadImg", "Helper")"
        };
    </script>
 

    <script src="~/Content/assets/plugins/validator/validator.js"></script>
    <script src="~/Content/assets/js/common.js"></script>
    <script src="~/Content/assets/DatePicker/WdatePicker.js"></script>
    <script src="~/Content/assets/layer/layer.min.js"></script>
    <script src="~/Content/assets/app/common/ajaxupload.js"></script>
    <script src="~/Content/assets/app/web/articleedit.js"></script>
 
    <script>
        KindEditor.ready(function(K) {
            window.editor = K.create('#Content', {
                resizeType: 1,
                allowPreviewEmoticons: false,
                allowImageUpload: false,
                minWidth: 350,
                allowFileManager: false,
                afterBlur: function() { this.sync(); }
            });
        });
         
        $("#selectProject").click(function () {
            ad1 = dialog("selectProject", "选择项目", "ProjectMgr/SelectCrowdfundingProject");
        });
        function dialog(id,title,url) {
            abc = $.dialog({
                id: id, lock: true, title: title, width: '710px', height: '520px', content: "url:" + url 
            });
            return abc;
        }
    </script>
}